import React, {useEffect, useState} from 'react';
import axios from "axios";
function Message(props) {
    const [messageList,setMessageList] = useState([]);
    useEffect(()=>{
        axios.get("http://zhangpeiyue.com/messageList").then(value=>{
            setMessageList(value.data);
        })
    },[]);
    return (
        <div>
            <ul>
                {
                    messageList.map(item=>(
                        <li key={item.id}>
                            <a href="/home/message/1">{item.title}</a> &nbsp;&nbsp;
                            <button>push</button>
                            &nbsp;
                            <button>replace</button>
                        </li>
                    ))
                }

            </ul>
            <button>前进</button>
            <button>后退</button>
        </div>
    );
}

export default Message;